/*LICENSE_BEGIN
 * ******************************************************************
 * Copyright 2006 by the Dainamite Robocup-Team at the
 * DAI-Labor, TU-Berlin (www.dai-labor.de)
 * 
 * Members of Dainamite are:
 * Holger Endert
 * Robert Wetzker
 * Thomas Karbe
 * Axel Heßler
 * Philippe Bütter
 * Felix Brossmann
 * 
 * Licensed under the GNU GPL (General Public License) Free Software 
 * License, Version 2. You may use this file only in compliance with 
 * the License. You may obtain a copy of the License at:
 * 
 * http://www.fsf.org/licensing/licenses/gpl.txt
 * ******************************************************************
LICENSE_END*/
package robocup.component.speechacts.coachlanguage;

import java.util.LinkedList;

public class Tok {

	private boolean clear = false;

	private int id = 0;

	private Condition condition = null;

	private LinkedList<Directive> directiveList = new LinkedList<Directive>();

	public void addDirective(Directive directive) {
		this.directiveList.add(directive);
	}

	public Condition getCondition() {
		return condition;
	}

	public void setCondition(Condition condition) {
		this.condition = condition;
	}

	public LinkedList<Directive> getDirectiveList() {
		return directiveList;
	}

	public void setDirectiveList(LinkedList<Directive> directiveList) {
		this.directiveList = directiveList;
	}

	public boolean isClear() {
		return clear;
	}

	public void setClear(boolean clear) {
		this.clear = clear;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String toString() {
		StringBuffer buf = new StringBuffer();
		if (clear)
			buf.append("(clear)");
		else {
			buf.append("(" + this.id + " " + this.condition.toString());
			for (Directive dir : this.directiveList)
				buf.append(" " + dir.toString());
			buf.append(")");
		}
		return buf.toString();
	}

}
